package visual;

import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

public class KMLCirclePlacemark extends KMLCircle {
	
	
	public String pluginStyle() {
		StringBuffer sb = new StringBuffer();	
		sb.append("<IconStyle>\n");
	    sb.append("<color>ff00f00f</color>\n");
		sb.append("<scale>.500</scale>\n");
		sb.append("<Icon>\n");
		sb.append("<href>http://maps.google.com/mapfiles/kml/shapes/square.png</href>\n");
		sb.append("</Icon>\n");
		sb.append("</IconStyle>");
		return sb.toString();
	}
	
	public String drawPlacemarkContent(double c_lon, double c_lat, double radius_form, int skip, String name, String color, String description) {
		StringBuffer sb = new StringBuffer();
		
		sb.append("<MultiGeometry>\n");
		sb.append(createPolygon(c_lon, c_lat, radius_form, skip));
		sb.append("<Point><coordinates>"+c_lon+","+c_lat+",0</coordinates></Point>\n");
		sb.append("</MultiGeometry>\n");
		
		
		
		return sb.toString();	
	}


	
	
	
	public static void main(String[] args) throws Exception {
		KMLCirclePlacemark kml_circle = new KMLCirclePlacemark();
		File fileOutput = new File("CircleTest.kml"); 
		PrintWriter out = new PrintWriter(new FileWriter(fileOutput));
		out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
		out.println("<kml xmlns=\"http://earth.google.com/kml/2.2\">");
		out.println("<Document>");
		out.println(kml_circle.draw(37.422000, -122.084073, 10000, 23, "ciao", "marco", "aa0000ff"));
		out.println("</Document>");
		out.println("</kml>");
		out.close();
		System.out.println("Done");
	}

}
